<template>
  <div class="qrcode_pop">
    <el-dialog
      :visible.sync="showQrcode"
      width="366px"
      :show-close="false"
      :close-on-click-modal="false">
      <div class="user_box">
        <div class="user_avatar">
          <img class="avatar-image" src="https://thirdwx.qlogo.cn/mmopen/vi_32/OQD4fMO3kYuJxibwZzlXy7cKs0Ech85xj7nAeHgFIA2sXJRkHFfaXhkia0WbyCmtzpmhPuJMbAwWPRu2VqVvnnBQ/132" />
        </div>
        <span class="user_nick">爱因斯坦1</span>
      </div>

      <div class="qrcode_box">
        <img class="qrcode" src="../../assets/test_qrcode.png" />
        <div class="code_text">使用微信扫一扫</div>
        <div class="code_text">加我为好友</div>
      </div>

      <a download="" href="javascript:;" class="download_qrcode">
        <img class="download_pic" src="../../assets/download_code.png" />
        <div class="download_text">保存到电脑</div>
      </a>
      
      <img class="cancel_btn" src="../../assets/icons/icon_close_up1.png" @click="cancelDialog" />
    </el-dialog>
  </div>
</template>

<script>
import {Dialog} from 'element-ui'
export default {
  name:'qrcode',
  data(){
      return {
          
      }
  },
  props: {
    showQrcode: Boolean
  },
  components: {
      'el-dialog':Dialog
  },
  methods:{
      cancelDialog(){
        this.$emit('cancelQrcode',false)
      }
  }
}
</script>

<style scoped>
.user_box{
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 52px;
}
.user_avatar{
  width: 50px;
  height: 50px;
  border-radius: 4px;
}
.avatar-image{
  width:100%;
  height:100%;
}
.user_nick{
    margin-left: 10px;
    font-size: 16px;
    color: #fff;
    max-width: 176px;
    text-align: left;
    letter-spacing: 1.5px;
}
.qrcode_box{
  width:240px;
  height:290px;
  border-radius: 12px;
  background: white;
  margin:20px auto;
  text-align: center;
}
.qrcode{
  width:198px;
  height:198px;
  margin-top:20px;
}
.code_text{
  margin-top:10px;
  color: #999;
  font-size: 12px;
  letter-spacing: 5px;
}
.download_qrcode{
  display: block;
  width:80px;
  height:85px;
  margin:0 auto;
}
.download_pic{
  width:48px;
  height:48px;
  display: block;
  margin:0 auto;
}
.download_text{
  font-size: 14px;
  color: #fff;
  margin-top: 18px;
  text-align: center;
}
.cancel_btn{
  position: absolute;
  top:30px;
  right:20px;
  width:30px;
  height:30px;
  cursor: pointer;
}
</style>